/* computer.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Courier New', monospace;
}

body {
    background-color: #0a0a14;
    color: #00f3ff;
    height: 100vh;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 100, 255, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 0, 255, 0.1) 0%, transparent 20%);
}

.cyber-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 15px;
    gap: 15px;
    background: rgba(10, 10, 20, 0.9);
    border: 1px solid #00f3ff;
    box-shadow: 
        0 0 20px rgba(0, 243, 255, 0.5),
        inset 0 0 20px rgba(0, 243, 255, 0.1);
}

/* 显示屏样式 */
.cyber-display {
    background-color: #000814;
    border: 2px solid #00f3ff;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 0 15px rgba(0, 243, 255, 0.7),
        inset 0 0 10px rgba(0, 243, 255, 0.2);
    height: 20%;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

.cyber-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff00ff, #00f3ff, #ff00ff);
    animation: scanline 3s linear infinite;
}

@keyframes scanline {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.display-main {
    font-size: 3.5rem;
    text-align: right;
    color: #00ff9d;
    font-weight: 300;
    letter-spacing: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-shadow: 0 0 10px rgba(0, 255, 157, 0.7);
}

.display-history {
    font-size: 1.2rem;
    color: #8a8aff;
    text-align: right;
    min-height: 24px;
    opacity: 0.8;
    border-top: 1px solid rgba(0, 243, 255, 0.3);
    padding-top: 8px;
}

.display-mode {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.display-mode span {
    padding: 5px 12px;
    border-radius: 4px;
    background-color: rgba(0, 50, 100, 0.5);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.display-mode span:hover {
    background-color: rgba(0, 150, 255, 0.5);
}

.mode-active {
    background-color: #0066ff !important;
    color: white;
    box-shadow: 0 0 10px #0066ff;
}

/* 计算器主体 */
.cyber-calculator {
    display: flex;
    gap: 15px;
    height: 60%;
    min-height: 400px;
}

.advanced-panel, .input-panel, .memory-panel {
    border: 1px solid #00f3ff;
    border-radius: 8px;
    padding: 15px;
    background-color: rgba(5, 10, 25, 0.8);
    box-shadow: 
        0 0 10px rgba(0, 243, 255, 0.5),
        inset 0 0 10px rgba(0, 243, 255, 0.1);
}

.advanced-panel {
    flex: 1;
    min-width: 250px;
}

.input-panel {
    flex: 2;
    display: flex;
    flex-direction: column;
}

.memory-panel {
    flex: 1;
    min-width: 200px;
}

.panel-title {
    color: #ff00ff;
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 0, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 按钮样式 */
.cyber-btn {
    background-color: #001122;
    color: #00f3ff;
    border: 1px solid #00aaff;
    border-radius: 6px;
    padding: 12px 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
    letter-spacing: 1px;
}

.cyber-btn:hover {
    background-color: #002244;
    color: #ffffff;
    border-color: #00ff9d;
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.7);
    transform: translateY(-2px);
}

.cyber-btn:active {
    transform: translateY(1px);
    box-shadow: 0 0 5px rgba(0, 255, 157, 0.5);
}

.op-btn {
    background-color: #003366;
}

.equals {
    background-color: #0066ff;
    color: white;
    border-color: #00aaff;
}

.func-btn, .mem-btn, .const-btn {
    background-color: #220033;
    color: #ff00ff;
    border-color: #ff00ff;
}

/* 布局 */
.function-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    overflow-y: auto;
    max-height: calc(100% - 40px);
    padding-right: 5px;
}

.basic-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    flex-grow: 1;
}

.memory-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.constant-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

/* 状态栏 */
.status-bar {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(0, 20, 40, 0.7);
    border-radius: 6px;
    border: 1px solid rgba(0, 150, 255, 0.3);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

#quantumStatus {
    color: #00ff9d;
}

#calcUnit {
    color: #ffaa00;
}

#memoryStatus {
    color: #ff66cc;
}

/* 控制面板 */
.control-panel {
    border: 1px solid #ff00ff;
    border-radius: 8px;
    padding: 15px;
    background-color: rgba(25, 5, 35, 0.8);
    height: 15%;
    min-height: 100px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-group label {
    color: #ff66cc;
    font-size: 1rem;
}

.control-group select, .control-group input {
    background-color: #001122;
    color: #00f3ff;
    border: 1px solid #ff00ff;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 1rem;
}

.control-btn {
    padding: 10px 20px;
    font-size: 1rem;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #001122;
    border: 2px solid #00f3ff;
    border-radius: 10px;
    width: 80%;
    max-width: 700px;
    max-height: 80%;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #002244;
    border-bottom: 1px solid #00f3ff;
}

.modal-header h2 {
    color: #00f3ff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    color: #ff00ff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
}

.matrix-size-selector {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

.matrix-input-container {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.matrix-input-container input {
    background-color: #000a1a;
    color: #00ff9d;
    border: 1px solid #00aaff;
    border-radius: 4px;
    padding: 10px;
    text-align: center;
    font-size: 1.1rem;
    width: 100%;
}

.matrix-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .cyber-calculator {
        flex-direction: column;
        height: auto;
    }
    
    .advanced-panel, .memory-panel {
        min-width: 100%;
    }
    
    .function-buttons {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .display-main {
        font-size: 2.5rem;
    }
    
    .function-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .basic-buttons {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .cyber-btn {
        padding: 10px 5px;
        font-size: 1rem;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 10px;
    }
}